/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package persistence.dao.mysql;

import persistence.entites.Tag;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;

/**
 *
 * @author Anthony
 */
public class TagDAO extends MySQLDAO<Tag> {

    public TagDAO(EntityManager em, Class<?> classe) {
        super(em, classe);
    }

    public List<Tag> findUnusedTag() {
        List<Tag> allTag = findAll();
        ArrayList<Tag> result = new ArrayList<Tag>();
        for (Tag tag : allTag) {
            if (tag.getPoi() == null) {
                result.add(tag);
            }
        }
        return result;
    }
}
